Fetch document classification [testing]
curl --request GET \
--url https://api.documents.testing.resistant.ai/v2/submission/{submission_id}/classification \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.documents.testing.resistant.ai/v2/submission/{submission_id}/classification"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.documents.testing.resistant.ai/v2/submission/{submission_id}/classification', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.documents.testing.resistant.ai/v2/submission/{submission_id}/classification",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.documents.testing.resistant.ai/v2/submission/{submission_id}/classification"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.documents.testing.resistant.ai/v2/submission/{submission_id}/classification")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.documents.testing.resistant.ai/v2/submission/{submission_id}/classification")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"analysis_time": "2024-03-15T10:30:00Z",
"deployment_version": "3.5.1",
"query_id": "customer-doc-789",
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"mime_type": "application/pdf",
"document_classification": {
"score": "CLASSIFIED",
"document_type": "bank_document",
"detailed_type": "bank_statement",
"issuer_parent": {
"name": "Example Banking Group",
"country": "GBR"
},
"issuer": {
"name": "Example Bank Ltd",
"country": "GBR",
"issuer_id": "07825439",
"legal_address": {
"street_address": "1 Example Street, London, EC1A 1BB"
}
},
"variant": null
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}API Reference
Fetch document classification [testing]
Fetch classification of the type of the submitted document
GET
/
v2
/
submission
/
{submission_id}
/
classification
Fetch document classification [testing]
curl --request GET \
--url https://api.documents.testing.resistant.ai/v2/submission/{submission_id}/classification \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.documents.testing.resistant.ai/v2/submission/{submission_id}/classification"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.documents.testing.resistant.ai/v2/submission/{submission_id}/classification', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.documents.testing.resistant.ai/v2/submission/{submission_id}/classification",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.documents.testing.resistant.ai/v2/submission/{submission_id}/classification"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.documents.testing.resistant.ai/v2/submission/{submission_id}/classification")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.documents.testing.resistant.ai/v2/submission/{submission_id}/classification")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"analysis_time": "2024-03-15T10:30:00Z",
"deployment_version": "3.5.1",
"query_id": "customer-doc-789",
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"mime_type": "application/pdf",
"document_classification": {
"score": "CLASSIFIED",
"document_type": "bank_document",
"detailed_type": "bank_statement",
"issuer_parent": {
"name": "Example Banking Group",
"country": "GBR"
},
"issuer": {
"name": "Example Bank Ltd",
"country": "GBR",
"issuer_id": "07825439",
"legal_address": {
"street_address": "1 Example Street, London, EC1A 1BB"
}
},
"variant": null
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Path Parameters
Response
Results of document type classification if classification analysis was enabled for the submission.
- Document type classification success response
- Pipeline failed
- Unprocessable input entity
- Pipeline was skipped
Available options:
SUCCESS Timestamp of analysis
Version of quality engine used for analysis
Maximum string length:
256Optional customer-defined identifier for correlating this submission with internal systems. Must not contain PII.
Maximum string length:
2048Sha256 of the input file
Required string length:
64Mime type of the input file, e.g. application/pdf, image/jpeg, etc.
Maximum string length:
256Information about the document type and issuer, or null if classification is not available
Show child attributes
Show child attributes
Was this page helpful?